<template>
	<view class="page">
    <u-navbar :fixed="false" leftIcon=" " placeholder bgColor="transparent"></u-navbar>
    <view class="actions">
      <view class="actions_title u-flex" @click="changeOrg">
        当前组织 - {{ orgInfo.orgName }}
        <u-icon name="edit-pen" color="#2979ff"></u-icon>
      </view>
      <view class="actions_title">常用功能</view>
      <view class="actions_item">
        <view class="item_content icon1" @click="toPage('/other/salesOrder/salesOrder')">
          <view class="item_box">
            <image src="../../static/icon/下单.png" mode="scaleToFill" />
            <view class="item_text">
              <text>销售下单</text>
              <text>销售下单</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
        <view class="item_content icon3" @click="toPage('/other/salesOrder/saleOrderPage')">
          <view class="item_box">
            <image src="../../static/icon/销售订单.png" mode="scaleToFill" />
            <view class="item_text">
              <text>销售订单列表</text>
              <text>销售订单列表</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
        <view class="item_content icon2" @click="toPage('/other/salesOrder/draftPage')">
          <view class="item_box">
            <image src="../../static/icon/草稿.png" mode="scaleToFill" />
            <view class="item_text">
              <text>草稿</text>
              <text>草稿</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
        <!-- <view class="item_content icon4" @click="toPage('/other/salesOrder/returnOrder')">
          <view class="item_box">
            <image src="../../static/icon/退货申请.png" mode="scaleToFill" />
            <view class="item_text">
              <text>退货申请</text>
              <text>退货申请</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view> -->
        <view class="item_content icon7" @click="toPage('/pages/login/org', {type: '3'})">
          <view class="item_box">
            <image src="../../static/icon/物料查询.png" mode="scaleToFill" />
            <view class="item_text">
              <text>物料查询</text>
              <text>物料查询</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
      </view>
    </view>
    <view class="actions">
      <view class="actions_title">其他功能</view>
      <view class="actions_item" @click="toPage('/pages/login/org', {type: '1'})">
        <view class="item_content icon6">
          <view class="item_box">
            <image src="../../static/icon/库存.png" mode="scaleToFill" />
            <view class="item_text">
              <text>库存查询</text>
              <text>库存查询</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
      </view>
      <view class="actions_item" @click="toPage('/other/purchase/list')">
        <view class="item_content icon1">
          <view class="item_box">
            <image src="../../static/icon/下单.png" mode="scaleToFill" />
            <view class="item_text">
              <text>采购订单</text>
              <text>采购订单</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
      </view>
      <view class="actions_item" @click="toPage('/other/purchase/warehousingList')">
        <view class="item_content icon3">
          <view class="item_box">
            <image src="../../static/icon/销售订单.png" mode="scaleToFill" />
            <view class="item_text">
              <text>入库单</text>
              <text>入库单</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
      </view>
      <view class="actions_item" @click="toPage('/pages/adjustment/adjustment')">
        <view class="item_content icon2">
          <view class="item_box">
            <image src="../../static/icon/库位调整.png" mode="scaleToFill" />
            <view class="item_text">
              <text>货位调整</text>
              <text>货位调整</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
      </view>
      <view class="actions_item" @click="toPage('/pages/login/org', {type: '4'})">
        <view class="item_content icon5">
          <view class="item_box">
            <image src="../../static/icon/报表查询.png" mode="scaleToFill" />
            <view class="item_text">
              <text>报表查询</text>
              <text>报表查询</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
      </view>
      <view class="actions_item" @click="toPage('/pages/adjustment/warehouse', { type: '1' })">
        <view class="item_content icon7">
          <view class="item_box">
            <image src="../../static/icon/物料查询.png" mode="scaleToFill" />
            <view class="item_text">
              <text>新增仓位</text>
              <text>新增仓位</text>
            </view>
          </view>
          <image src="../../static/rightWhite.png" mode="scaleToFill" />
        </view>
      </view>
    </view>
    <view class="logout" @click="logout">退出登录</view>
	</view>
</template>

<script>

export default {
  data() {
    return {
      orgInfo: {},
    }
  },
  onShow() {
    this.orgInfo = uni.getStorageSync('orgInfo')
  },
  methods: {
    toPage(url, p={}) {
      this.jumpTo(url, p)
    },
    changeOrg() {
      this.toPage('/pages/login/org', {type: '2'})
    },
    logout() {
      uni.removeStorageSync('token')
			this.reLaunch('/pages/login/login')
    },
  }
}
</script>

<style lang="scss" scoped>
.page{
	width: 750rpx;
	min-height: 100vh;
  padding-bottom: 40rpx;
  .actions {
    box-sizing: border-box;
    width: 690rpx;
    border-radius: 8rpx;
    padding: 24rpx 5rpx 0 12rpx;
    margin: 0 auto 40rpx;
    .actions_title {
      font-size: 30rpx;
      font-weight: bold;
      color: #333333;
      margin-bottom: 30rpx;
    }
    .actions_item {
      .item_content {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 123rpx;
        border-radius: 8rpx;
        padding: 25rpx 52rpx 22rpx;
        margin-bottom: 17rpx;
        .item_box {
          display: flex;
          image {
            width: 78rpx;
            height: 78rpx;
            border-radius: 50%;
            margin-bottom: 12rpx;
            margin-right: 28rpx;
          }
          .item_text {
            display: flex;
            flex-direction: column;
            text {
              font-size: 28rpx;
              color: #fff;
            }
            text:nth-child(2) {
              font-size: 20rpx;
            }
          }
        }
        image {
          width: 12rpx;
          height: 22rpx;
        }
      }
      .icon1 {
        background: linear-gradient(193deg, #f49065, #f69388);
      }
      .icon2 {
        background: linear-gradient(193deg, #60bdf0, #86aaf4);
      }
      .icon3 {
        background: linear-gradient(193deg, #f7d22d, #f7a32d);
      }
      .icon4 {
        background: linear-gradient(193deg, #86aaf4, #3590ff);
      }
      .icon5 {
        background: linear-gradient(193deg, #86aaf4, #768af0);
      }
      .icon6 {
        background: linear-gradient(193deg, #f69388, #f65c65);
      }
      .icon7 {
        background: linear-gradient(193deg, #f69388, #F67032);
      }
    }
  }
}
.logout {
  width: 630rpx;
  height: 90rpx;
  line-height: 90rpx;
  text-align: center;
  margin: 72rpx auto 42rpx;
  border-radius: 46rpx;
  background: #2979ff;
  color: #FFF;
  font-family: "PingFang SC";
  font-size: 36rpx;
}
</style>
